package com.example.service;

import com.example.constants.RabbitConts;
import com.example.model.vo.PCodeVo;
import com.example.untils.SMSUtil;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author 27954
 * @Description TODO
 * @Date 2022/9/15 18:51
 */

@Component
public class PhoneService {
    @Autowired
    private SMSUtil smsUtil;
    @RabbitHandler
    @RabbitListener(queues = RabbitConts.PHONE_QUEUES)
    public void hello(PCodeVo pCodeVo)
    {

        smsUtil.sendSMS(Integer.valueOf(pCodeVo.getCode()));
    }
}
